<template>
  <h2>前端代码演示</h2>
  <el-button type="primary" @click="close()">关闭页面</el-button>
  <el-button type="primary" @click="open()">重新打开</el-button>
</template>
<script lang="ts" setup>
import { useRouter } from 'vue-router'
// import { ref, reactive, onMounted } from 'vue'
const router = useRouter()
function close() {
  // window.close()
  // window.location.href = '/about'
  // router.push({ path: '/login' })
  alert('检测到登录了多个用户，当前用户已被强制下线？')
  // setTimeout(() => {
  window.opener = null
  window.open('about:blank', '_top').close()
  // }, 1000)
}
function open() {
  window.open('/home', '_blank')
}
</script>
<style lang="less" scoped></style>
